/*
 * Event.h
 *
 *  Created on: Jun 19, 2011
 *      Author: michael
 */

#ifndef EVENT_H_
#define EVENT_H_


namespace DerbyServ
{

class MainManager;

class Event
{
public:
	Event();
	virtual ~Event();

	virtual void Actions(MainManager & mgr) {}
};
typedef boost::shared_ptr<Event> EventPtr;

class TimeEvent : public Event
{
public:
	double Time_secs() const {return scheduledTime;}
private:
	double scheduledTime;
};
typedef boost::shared_ptr<TimeEvent> TimeEventPtr;

struct TimeEventComparisonPredicate
{
	friend class TimeEvent;

	bool operator () (TimeEventPtr e1, TimeEventPtr e2) const
	{
		return e1->Time_secs() < e2->Time_secs();
	}
};

class StateEvent : public Event
{
public:
	virtual bool Conditions(MainManager & mgr) { return true; }
};
typedef boost::shared_ptr<StateEvent> StateEventPtr;

}

#endif /* EVENT_H_ */
